package com.example.shirotest.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shirotest.entry.Result;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface ResultMapper extends BaseMapper<Result> {

    @Select("SELECT * FROM result WHERE sid=#{sid} ORDER BY id DESC LIMIT 50")
    ArrayList<Result> selectBySid(Integer sid);

    @Select("SELECT * FROM result ORDER BY id desc")
    List<Result> findPage();

    @Select("SELECT * FROM result WHERE sid=#{sid} ORDER BY id desc")
    List<Result> findPageBySid(Integer sid);

}
